<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTradingBannersTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('trading_banners', function (Blueprint $table) {
            $table->increments('id');
            $table->boolean('is_open')->nullable()->default(true)->comment('是否开启');
            $table->unsignedInteger('sort')->comment('排序');
            $table->unsignedTinyInteger('type')->comment('类型:1-App banner图 ; 2-Web banner图');
            $table->string('title')->comment('标题');
            $table->string('picture')->comment('图片');
            $table->string('large_picture')->nullable()->default(null)->comment('大图片（Web端用）');
            $table->string('link')->nullable()->default(null)->comment('链接');
            $table->unsignedInteger('started_at')->nullable()->default(null)->comment('开始时间');
            $table->unsignedInteger('stopped_at')->nullable()->default(null)->comment('结束时间');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('trading_banners');
    }
}
